package com.yoshino.iterator;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

/**
 * @author yoshino
 **/
public class InfoCollege implements College{

    List<Department> departmentList;
    int numOfDepartment = 0; // 保存当前数组的对象个数

    public InfoCollege() {
        departmentList = new ArrayList<>();
        addDepartment("信息安全","信息安全");
        addDepartment("网络安全", "网络");
    }

    @Override
    public String getName() {
        return "信息工程学院";
    }

    @Override
    public void addDepartment(String name, String desc) {
        Department department = new Department(name, desc);
        departmentList.add(department);
    }

    @Override
    public Iterator createIterator() {
        return new InfoCollegeIterate(departmentList);
    }
}
